package com.lezhi.socialgram.exception;

import com.lezhi.socialgram.enums.ResultEnum;

/**
 * Created by daizhen on 2017/3/16.
 */
public class SocialGramException extends RuntimeException {

    private String code;

    public SocialGramException(ResultEnum resultEnum) {
        super(resultEnum.getMessage());
        this.code = resultEnum.getCode();
    }

    public SocialGramException(String message) {
        super(message);
        this.code = ResultEnum.PARAM_NOT_ALLOWED.getCode();
    }

    public String getCode() {
        return code;
    }
}
